package net.wzw.rule;

import lombok.extern.slf4j.Slf4j;
import org.jeasy.rules.annotation.Action;
import org.jeasy.rules.annotation.Condition;
import org.jeasy.rules.annotation.Fact;
import org.jeasy.rules.annotation.Rule;

/**
 * @author wzw
 * @date 2025/4/2
 * @Description
 */
@Slf4j
@Rule(name = "临时规则", description = "天冷穿【毛衣】才能出门", priority = 3)
public class TempRule {

    @Condition
    public boolean getCloth(@Fact("temp") String cloth) {

        log.info("cloth={}", cloth);
        //这块可增加逻辑,比如从数据库中取数
        return cloth.equals("毛衣");
    }

    @Action(order = 1)
    public void applyA() {

        log.info("触发临时穿毛衣规则!");


    }

    @Action(order = 2)
    public void applyB() {

        log.info("触发临时拿伞规则触发!");


    }


}
